﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace RecipeBookWeb
{
    public partial class MyRecipes : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["CurrentUser"] == null)
                Response.Redirect("Default.aspx");

            if (!Page.IsPostBack)
            {
                FavoriteGridView.DataSource = RecipeBookBusiness.ModelFacade.GetUserFavorites(Session["CurrentUser"].ToString());
                FavoriteGridView.DataBind();

                AddedRecipeGridView.DataSource = RecipeBookBusiness.ModelFacade.GetOwnerRecipes(Session["CurrentUser"].ToString());
                AddedRecipeGridView.DataBind();
            }
        }
    }
}
